package cn.itcast.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result {
    //状态码0失败,1成功
    private Integer code;
    //返回结果提示信息
    private String message;
    //返回数据类型
    private Object data;
    public static Result success(Object data){
        return new Result(1,null,data);
    }
    public static Result success(String message,Object data){
        return new Result(1,message,data);
    }
    public static Result success(String message){
        return new Result(1,message,null);
    }
    public static Result error(String message){
        return new Result(0,message,null);
    }
}
